<html lang="zh">
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<head>
    <style>
        table.gridtable {
            font-family: verdana, arial, sans-serif;
            font-size: 11px;
            color: #333333;
            border-width: 1px;
            border-color: #666666;
            border-collapse: collapse;
            width: 800px;
        }

        table.gridtable th {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #dedede;
        }

        table.gridtable td {
            border-width: 1px;
            padding: 8px;
            border-style: solid;
            border-color: #666666;
            background-color: #ffffff;
        }
    </style>

</head>
<body>

<div style="float: right;margin-right: 20px;margin-top: 10px;">
   欢迎您, ${userAuth.username} (${userAuth.role})
    <a href="/logout">logout</a>
</div>

<h2>login success</h2>
<br><br>
<a href="/greeting">无需任何权限即可访问</a><br><br>
<a href="/greeting3">访问报错（要求用户有manager权限）</a><br><br>
<a href="/greeting2?name=${userAuth.username}">登录访问权限(要求用户有admin,manager权限)</a><br><br>
<br>
<br>
<br>
<a href="/user/addUser">随机新增5个用户</a>
<table class="gridtable">
    <tr>
        <th>ID</th>
        <th>username</th>
        <th>password</th>
        <th>role</th>
        <th>age</th>
        <th>brief</th>
        <th>operation</th>
    </tr>

    <c:forEach items="${userLists }" var="row" varStatus="status">
        <tr>
            <td style="text-align: center; width: 10%;">
                    ${row.id}
            </td>
            <td>
                    ${row.username}
            </td>
            <td>
                    ${row.password}
            </td>
            <td>
                    ${row.role}
            </td>
            <td>
                    ${row.age}
            </td>

            <td>
                    ${row.brief}
            </td>
            <td>
                <a href="/user/view/${row.id}">查看</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="/user/remove/${row.id}">删除</a>
            </td>
        </tr>
    </c:forEach>

</table>
<script type="text/javascript">
    if ('${info}'.length > 0) {
        alert('${info}');
    }

</script>
</body>
</html>
